<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderRefundTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_refund', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('order_id')  ->comment('订单id');
            $table->string('order_num')     ->comment('订单号');
            $table->string('refund_num')    ->comment('退款单号');
            $table->decimal('refund_amount')->default(0)->comment('退款金额');
            $table->string('fail_cause')   ->nullable()->comment('失败原因');
            $table->integer('status')       ->default(0)->comment('0已记录申请，1退款成功，2退款失败');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
//        Schema::dropIfExists('order_refund');
    }
}
